Learn R Programming

SpatialExtremes (version 2.1-0)

margin fits: Fits univariate extreme value distributions to data

Description

These functions fit the generalised extreme value and generalised Pareto distribution to data using maximum likelihood.

Usage

gevmle(x, …, method = "Nelder")
gpdmle(x, threshold, …, method = "Nelder")

Arguments

x

Numeric vector of observations

Optional arguments to be passed to the optim function.

threshold

Numeric. The threshold value.

method

The numerical optimisation method to be used.

Value

A vector for the estimated parameters of the GEV/GPD.

Details

These two functions are ``extremely light'' functions to fit the GEV/GPD. These functions are mainly useful to compute starting values for the Schlather and Smith model - see fitmaxstab.

If more refined (univariate) analysis have to be performed, users should use more specialised packages - e.g. POT, evd, ismev, ….

Examples

Run this code
# NOT RUN {
## 1 - GEV fit
x <- rep(NA, 100)
for (i in 1:100)
  x[i] <- max(rnorm(365))

gevmle(x)

## 2- GPD fit
x <- rnorm(10000)
##we need to fix a threshold
u <- quantile(x, 0.99)
gpdmle(x, u)
# }

Run the code above in your browser using DataLab